package net.onceface.core.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import net.onceface.core.domain.mappedsuper.Party;

/**
 * 商品分类
 * **/
@Entity
@Table(name = "SYS_CATEGORY")
public class Category extends Party{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * 分类代码
	 * **/
	@Column(name="CODE")
	private int code;
	
	/**
	 * 父分类ID
	 * **/
	@Column(name="PARENT_ID")
	private Long parentId;
	
	/**
	 * 图片
	 * **/
	@Column(name="PICTURE")
	private String picture;
	
	/**
	 * 是否可用
	 * **/
	@Column(name="DISABLED")
	private boolean disabled;
	
	/**
	 * 简介
	 * **/
	@Column(name="REMARK")
	private String remark;
	
	/**
	 * 父类
	 * **/
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "parent_ID", insertable=false,updatable=false)
	private Category parent;

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public String getPicture() {
		return picture;
	}

	public void setPicture(String picture) {
		this.picture = picture;
	}

	public boolean isDisabled() {
		return disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Category getParent() {
		return parent;
	}

	public void setParent(Category parent) {
		this.parent = parent;
	}

	@Override
	public String[] businessKeys() {
		// TODO Auto-generated method stub
		return null;
	}

}
